fix(posthog): upgrade SDKs and fix serverless event flushing#3951
fix(posthog): upgrade SDKs and fix serverless event flushing#3951waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Moves PostHog shutdown/flush handling out of OpenTelemetry initialization: OTel now only shuts down its own SDK, while Reviewed by Cursor Bugbot for commit 6ab5fa5. Configure here. |
|
@greptile |
|
@cursor review |
Greptile SummaryThis PR fixes a real bug where the PostHog Key changes:
Confidence Score: 5/5Safe to merge — the change is a straightforward and correct refactor with no logic regressions. The OTel/PostHog separation is exactly right: OTel shutdown belongs inside initializeOpenTelemetry() because it depends on the sdk instance, while PostHog shutdown belongs in register() since it must always run. No P0 or P1 issues found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Next as Next.js Runtime
participant Reg as register()
participant OTel as initializeOpenTelemetry()
participant PH as PostHog Client
participant OS as OS Signal
Next->>Reg: call register()
Reg->>OTel: await initializeOpenTelemetry()
alt OTel enabled
OTel->>OTel: start SDK
OTel->>OS: register shutdownOtel on SIGTERM/SIGINT
else OTel disabled
OTel-->>Reg: return early (no OTel handlers)
end
Reg->>OS: register shutdownPostHog on SIGTERM/SIGINT
Note over Reg,OS: PostHog handler always registered
OS->>OTel: SIGTERM/SIGINT (if OTel enabled)
OTel->>OTel: sdk.shutdown()
OS->>PH: SIGTERM/SIGINT
PH->>PH: flush & shutdown
Reviews (1): Last reviewed commit: "fix(posthog): revert flushAt to 20 for l..." | Re-trigger Greptile |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6ab5fa5. Configure here.
Summary
posthog-js1.334.1 → 1.364.4,posthog-node5.9.2 → 5.28.9Type of Change
Testing
tsc --noEmitpasses with zero errorscapture,shutdown,init,identify,reset,__loaded,PostHogProvider) still exist in new versionsperson_profiles,autocapture,session_recording,persistence, etc.) still validChecklist